<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<%@ include file="/jsp/imports/header.jsp" %>
	<script>
	function foward(acao){
		document.form.action = acao;
		document.form.submit();
	}
</script>
</head>

<body>
<c:set var="page" value="jsp/diretor/turma/dirCadastraTurma.jsp" scope="session"/>
<div class="contentwrap">
	
<div class="headwrap">


  <%@ include file="/jsp/imports/top.jsp" %>   
    


	<div class="container content">
		
	  <div class="span-20 append-2 prepend-2">
	   
        <%@ include file="/jsp/imports/mensagens.jsp" %>
    
  <%@include file="/jsp/imports/menuLateral.jsp" %>

		  <div class="span-12 services last">
		  	<h2 align="center"><fmt:message key="cadastroTurma.titulo"/></h2>
			<br/>
			<form action="cadastraTurma.do" method="post" name="form">
				<table>
					<tr>
						<td><fmt:message key="codigo"/></td>
						<td><input type="text" name="codigo" id="codigo" value="${param.codigo}" maxlength="3"/></td>
					</tr>
					<tr>
						<td><fmt:message key="diaSemana"/></td>
						<td>
						<input type="checkbox" name="diaSemana" value="2" onselect="isDiaSelecionado(2);"/><fmt:message key="segunda"/>
						<input type="checkbox" name="diaSemana" value="3" <c:out value="isDiaSelecionado(3);"/>/><fmt:message key="terca"/>
						<input type="checkbox" name="diaSemana" value="4" <c:out value="isDiaSelecionado(4);"/>/><fmt:message key="quarta"/>
						<input type="checkbox" name="diaSemana" value="5" <c:out value="isDiaSelecionado(5);"/>/><fmt:message key="quinta"/>
						<input type="checkbox" name="diaSemana" value="6" <c:out value="isDiaSelecionado(6);"/>/><fmt:message key="sexta"/>
						<input type="checkbox" name="diaSemana" value="7" <c:out value="isDiaSelecionado(7);"/>/><fmt:message key="sabado"/>
						</td>
					</tr>
					<tr>
						<td><fmt:message key="horario"/></td>
						<td><input type="text" name="horario" id="horario" value="${param.horario}" maxlength="10"/></td>
					</tr>
					<tr>
						<td><fmt:message key="semestre"/></td>
						<td>
							<select name="semestre">
								<option selected="selected" ></option>
								<option value="1" <c:out value="${param.semestre == '1' ? 'selected' : ''}"/>>1</option>
								<option value="2" <c:out value="${param.semestre == '2' ? 'selected' : ''}"/>>2</option>
							</select>
						</td>
					</tr>
					<tr>
						<td><fmt:message key="ano"/></td>
						<td><input type="text" name="ano" id="ano" maxlength="4" value="${param.ano}"/></td>
					</tr>
					<tr>
						<td><fmt:message key="periodoMinistrado"/></td>
						<td><input type="text" name="periodoMinistrado" id="periodoMinistrado" value="${param.periodoMinistrado}" maxlength="15"/></td>
					</tr>
					<tr>
						<td><fmt:message key="disciplina"/></td>
						<td>
							<select name="disciplina">
								<option selected="selected"/>
								<c:forEach items="${disciplinas}" var="disciplinaNome">
									<option value="${disciplinaNome.idDisciplina}" <c:out value="${param.disciplina == disciplinaNome.idDisciplina ? 'selected' : ''}"/>><c:out value="${disciplinaNome.nome}" /></option>
								</c:forEach>
							</select>
						</td>
					</tr>
					<tr>
						<td><fmt:message key="professor"/></td>
						<td>
							<select name="professor">
							    <option selected="selected"/>
								<c:forEach items="${professores}" var="professorNome">
									<option value="${professorNome.idProfessor}" <c:out value="${param.professor == professorNome.idProfessor ? 'selected' : ''}"/>><c:out value="${professorNome.nome}" /></option>
								</c:forEach>
							</select>
						</td>
					</tr>
					<tr>
						<td><fmt:message key="curso"/></td>
						<td>
							<select name="curso">
								<option selected="selected" />
								<c:forEach items="${cursos}" var="curso">
									<option value="${curso.idCurso}" <c:out value="${param.curso == curso.idCurso ? 'selected' : ''}"/>><c:out value="${curso.nome}"/></option>
								</c:forEach>
							</select>
						</td>
					</tr>
					<tr>
					</tr>
				</table>
				<input type="submit" value="<fmt:message key="botao.cadastrar"/>"/>
				<input type="button" value="<fmt:message key="botao.cancelar"/>" onclick="foward('${pageContext.request.contextPath}/jsp/index.jsp')"/>
			</form>

		  
		  </div>
			
		  <div class="final"></div>
		
		</div>
	
	</div>

</div>

</div>

<%@ include file="/jsp/imports/footer.jsp" %>
</body>
</html>